<template>
  <div class="padding-lr20">
    <div class="padding-tb40">
      <div class="line-height-100">{{$route.params.title}}</div>
      <div class="border text-content padding-40 rem-32px text-33">
        <textarea name id cols="30" rows="10" v-model="value"></textarea>
      </div>
    </div>

    <div class="margin-t80">
      <div class="sure bg-ff0 text-ff text-center letter-10" @click="sure">保存</div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      value: ""
    };
  },
  mounted() {
    document.querySelector('html').style.backgroundColor = "#ffffff";
    this.value = this.$route.params.value;
  },
  methods: {
    sure() {
      if (!this.value && this.$route.params.notnull == 1) {
        this.$toast("内容不能为空~");
        return false;
      }
      this.$axios.post( "/wap/personal/editUserInfo", {
        token: window.localStorage.getItem("token"),
        key: this.$route.params.type,
        value: this.value
      }).then(res => {
        this.$toast(res.data.msg);
        if (res.data.code == 0) {
          this.$router.go(-1);
        }
      });
    }
  }
};
</script>

<style scoped>
.border {
  border: 0.01rem solid #d1d1d1;
  border-radius: 0.1rem;
}
textarea {
  width: 100%;
  height: 3.2rem;
}
</style>